package com.ym.medical.service;

import com.ym.core.utils.tkmybatis.IBaseSV;
import com.ym.medical.domain.entity.UserEntity;
import com.ym.medical.domain.entity.YunxinUserEntity;
import com.ym.medical.domain.param.YunxinUserParam;

import java.util.List;

/**
 * 云信Service接口
 *
 * @author ym
 * @date 2020-08-17
 */
public interface IYunxinUserSV extends IBaseSV<YunxinUserEntity> {

	/**
	 * 新增
	 *
	 * @param yunxinUser
	 * @return
	 */
	long save(YunxinUserEntity yunxinUser);

	/**
	 * 根据ID查找
	 *
	 * @param id
	 * @return
	 */
	YunxinUserEntity findById(long id);

	/**
	 * 根据model查找
	 *
	 * @param yunxinUserModel
	 * @return
	 */
	YunxinUserEntity findByModel(YunxinUserParam yunxinUserModel);

	/**
	 * 根据model列表查找
	 *
	 * @param yunxinUserModel
	 * @return
	 */
	List<YunxinUserEntity> list(YunxinUserParam yunxinUserModel);

	/**
	 * 完善云信账号信息
	 *
	 * @param userId 用户ID
	 * @return
	 */
	void updateYunxinAcc(Long userId);

	/**
	 * 消息推送
	 *
	 * @param body
	 */
	void syncMessages(String body);

	/**
	 * 医生和当前患者的云信账号
	 * @param doctId
	 * @param userId
	 * @return
	 */
	List<YunxinUserEntity> selectYunXinId(Long doctId, Long userId);
	
	/**
	 * 获取云信账号
	 *
	 * @param userEntity
	 */
	YunxinUserEntity createYxUserAccount(UserEntity userEntity);
	/**
	 * 创建云信账户
	 *
	 * @param userId 用户ID
	 * @return
	 */
	YunxinUserEntity createYunxinAcc(Long userId);
}
